/**************************************************************************************
* Component of simpleRTJ regression tests.
**************************************************************************************
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL RTJ COMPUTING BE LIABLE FOR ANY CLAIM, DAMAGES
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Created by:
*       RTJ Computing
**************************************************************************************/
public class TestObjectInitialisation
{
    int i = 0;
    {
        i++;
    }

    public TestObjectInitialisation()
    {
        if (i == 1) {
            i++;
        }
    }

    {
        i++;
    }

    public static void test() throws Exception
    {
        TestObjectInitialisation ti = new TestObjectInitialisation();
        if (ti.i != 2) throw new Exception("OINI1");

        TestOI2 ti2 = new TestOI2();
        if (ti2.i != 3) throw new Exception("OINI2");
    }

}

class TestOI2 extends TestObjectInitialisation
{
    {
        if (i == 2) {
            i ++;
        }
    }
}
